#include "pch.h"
#include "ShadowMapDemo.h"
#include "Scene.h"
#include "RendererEngine.h"
#include "renderer.h"
#include "ShadowRenderer.h"
#include "ShadowMap.h"

CShadowmapDemo::CShadowmapDemo()
{

}

CShadowmapDemo::~CShadowmapDemo()
{

}

void CShadowmapDemo::init(mini::CEngine* pEngine)
{
	auto pRenderer = mini::CRendererEngine::getSinglePtr()->findRenderer(mini::RendererType::ShadowRenderer);
	if (nullptr != pRenderer)
	{
		auto pShadowRenderer = dynamic_cast<mini::CShadowRenderer*>(pRenderer);
		if (nullptr != pShadowRenderer)
		{
#if 0
			mini::CSoftShadowMap* pShadow = new mini::CSoftShadowMap();
			pShadow->initShadowTexutre(1024);
#else
			mini::CShadowMap* pShadow = new mini::CShadowMap();
#endif
			pShadowRenderer->setEffect(pShadow);
			SafeRelease(pShadow);
		}
	}
}


